package sv.gob.mtps.colectivas.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import sv.gob.mtps.colectivas.model.TbSolicitud;
import sv.gob.mtps.colectivas.model.VwDepartamentoMunicipio;
import sv.gob.mtps.colectivas.service.FindService;

@Controller
public class FindController {
	
	@Autowired
	FindService findService;
	
	@RequestMapping(value = "/admin/findEmp")
	public  String findEmp(@ModelAttribute("solicitud") TbSolicitud tbSolicitud,BindingResult result,Map<String, Object> map){
		map.put("empleadorList", findService.listEmpleadores());
		return "admin/find_Empleador";		
	}
	
	@RequestMapping(value = "/admin/findMunicipio")
	public  String findMuni(@ModelAttribute("municipio") VwDepartamentoMunicipio vwDepMuni,BindingResult result,Map<String, Object> map){
		map.put("municipioList", findService.listMunicipios());
		return "admin/find_Municipio";		
	}

}
